<template>
  <div class=''></div>
</template>
<script>
import axios from 'axios'
export default {
  name: 'name',
  title: 'title',
  data() {
    return {}
  },
  methods: {
    quchong (haystack, needle) {
      const len1 = haystack.length
      const len2 = needle.length
      if (len2 > len1) {
        return -1
      }
      if (haystack === needle || len2 === 0) {
        return 0
      }
      for (let i = 0; i < len1-len2; i++) {
        if (haystack.slice(i,  i + len2) === needle) {
          return i
        }
      }
      return -1
    }
  }
}
</script>
<style lang = 'less'>
</style>